import type { ProColumns } from '@ant-design/pro-table';
export type columnsDataType = {
    id: number,
    order: number,
    merchantName: string
    merchantNumber: number
    contacts: string
    mailbox: string
    telephone: string
    effectiveDiscount: string
    registrationDate: string
    state: string,
    comments: number
};
const valueEnum = {
    0: 'close',
    1: 'running',
    2: 'online',
    3: 'error',
  };
  
const columnsData: ProColumns<columnsDataType>[] = [

    // 配置搜索框
    {
        title: '户名',
        dataIndex: 'merchantName',
        hideInTable: true,
    },
    {
        title: '账号',
        dataIndex: 'merchantNumber',
        hideInTable: true,
    },
    {
        title: '持有人类别',
        dataIndex: 'state',
        valueType: 'select',
        hideInTable: true,
        valueEnum: {
            all: { text: '全部', status: 'Default' },
            open: {
                text: '全部',
                status: 'Error',
            },
            closed: {
                text: '锁定',
                status: 'Success',
            },
            processing: {
                text: '正常',
                status: 'Processing',
            },
        },
    },
    {
        title: '账户状态',
        dataIndex: 'state',
        valueType: 'select',
        hideInTable: true,
        valueEnum: {
            all: { text: '全部', status: 'Default' },
            closed: {
                text: '锁定',
                status: 'Success',
            },
            processing: {
                text: '正常',
                status: 'Processing',
            },
        },
    },
    {
        title: '开户日期',
        dataIndex: 'registerDate',
        valueType: 'dateRange',
        colSize: 1,
        hideInTable: true,
        search: {
            transform: (value) => {
                return {
                    startTime: value[0],
                    endTime: value[1],
                };
            },
        },
    },

    // table里面的内容
    {
        title: '序号',
        dataIndex: 'order',
        hideInSearch: true,
    },
    {
        title: '户名',
        dataIndex: 'merchantName',
        hideInSearch: true,
    },
    {
        title: '客户号',
        dataIndex: 'merchantNumber',
        hideInSearch: true,
    },
    {
        title: '账号',
        dataIndex: 'mailbox',
        hideInSearch: true,
    },
    {
        title: '余额',
        dataIndex: 'money',
        hideInSearch: true,
    },
    {
        title: '持有人类别',
        hideInSearch: true,
        dataIndex: 'state',
        valueType: 'select',
    },
    {
        title: '开户时间',
        dataIndex: 'registrationDate',
        hideInSearch: true,
    },
    {
        title: '账号状态',
        hideInSearch: true,
        dataIndex: 'state',
        valueType: 'select',
        valueEnum: {
            effect: {
                text: '生效',
                status: 'Success',
            },
            invalid: {
                text: '失效',
                status: 'Error',
            },
        },
    },
    {
        title: '操作',
        hideInSearch: true,
        dataIndex: 'action',
    },
];

export default columnsData;